package www.wen.com.common.lib.initializer

import android.content.Context
import androidx.startup.Initializer
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import www.wen.com.common.BuildConfig

/**
 * @author WEN
 * @Description:
 * @date 2020/11/30 3:02
 */
class LoggerInitializer : Initializer<Unit> {

    override fun create(context: Context) {
        Logger.addLogAdapter(object : AndroidLogAdapter() {
            override fun isLoggable(priority: Int, tag: String?): Boolean {
                return BuildConfig.DEBUG
            }
        })
    }

    override fun dependencies(): List<Class<out Initializer<*>>> = emptyList()

}

